<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>项目客户账户信息表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="prjCstAccInfo_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">

        <div class="fieldBox col_100">
            <div class="label">项目ID</div>
            <div class="field">
                ${prjCstAccInfoVO.prjId}
            </div>
        </div>
        <%--<div class="fieldBox col_100">
            <div class="label">客户ID</div>
            <div class="field">
                <input name="cstId" id="cstId" type="text" class="ui-textbox" value="${prjCstAccInfoVO.cstId}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>--%>
        <div class="fieldBox col_100">
            <div class="label">客户名称</div>
            <div class="field">
                ${prjCstAccInfoVO.cstNm}
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">证件类型</div>
            <div class="field">
                ${prjCstAccInfoVO.certTypCdNm}
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">证件号码</div>
            <div class="field">
                ${prjCstAccInfoVO.certNo}
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">开户银行</div>
            <div class="field">
                <input name="bkNo" id="bkNo" data-value="${prjCstAccInfoVO.bkNo}" placeholder="请选择" ltype="combobox" validate="{required:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">银行账号</div>
            <div class="field">
                <input name="accNo" id="accNo" type="text" class="ui-textbox" value="${prjCstAccInfoVO.accNo}" validate="{required:true,maxlength:22,minlength:15}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">手机号</div>
            <div class="field">
                <input name="mp" id="mp" type="text" class="ui-textbox" value="${prjCstAccInfoVO.mp}"
                       validate="{required:true,maxlength:11,minlength:11}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">校验结果</div>
            <div class="field">
                ${prjCstAccInfoVO.chkRstCdNm}-${prjCstAccInfoVO.rstDesc}
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">校验结果</div>
            <div class="field">
                <input name="chkRstCd" id="chkRstCd" data-value="${prjCstAccInfoVO.chkRstCd}" placeholder="请选择" ltype="combobox" validate="{required:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
    </div>
    <div class="btnsBox">
        <span id="savePrjCstAccInfo_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    $(function () {
        var prjCstAccInfoId = "${prjCstAccInfoVO.id}";//主键ID
        //初始化银行列表
        $("#bkNo").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            autocomplete: function (e) {
                filter_autoComboboxData(e.key, this);
                e.show();
            },
        });
        //初始化
        $("#chkRstCd").ligerComboBox({
            valueField: 'key',
            textField: 'value',
        });
        $("#prjCstAccInfo_form").ligerForm({
            validate: true
        });
        liger.get("bkNo").setData(${bankList});
        liger.get("bkNo").updateStyle();
        liger.get("chkRstCd").setData(${chkRstCdList});
        liger.get("chkRstCd").updateStyle();
        /*保存*/
        $("#savePrjCstAccInfo_Btn").click(function (event) {
            var form = liger.get("prjCstAccInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            data["bkNo"] = liger.get("bkNo").selectedValue;
            data["bkNm"] = liger.get("bkNo").selectedText;
            $.ligerDialog.hide();
            var _url = '<%=path%>/project/prjCstAccInfo/modify.do?id=' + prjCstAccInfoId;
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
</script>
</body>
</html>
